Skip to content

feat(wasm-utxo): add Psbt wrapper class with typed interface#207

Merged
OttoAllmendinger merged 1 commit intomasterfrom
BTC-2650.add-psbt-class-wrapper
Mar 12, 2026
Merged

feat(wasm-utxo): add Psbt wrapper class with typed interface#207
OttoAllmendinger merged 1 commit intomasterfrom
BTC-2650.add-psbt-class-wrapper

Conversation

@OttoAllmendinger
Copy link
Contributor

Introduce a new TypeScript Psbt class that wraps WasmPsbt and
implements the IPsbt interface. This provides a cleaner, more
type-safe API compared to using the WASM types directly.

The wrapper:

  • Encapsulates WASM instance management
  • Provides factory methods for creation and deserialization
  • Implements all IPsbt interface methods
  • Adds descriptor-based update methods
  • Includes signature verification and validation
  • Supports transaction extraction with proper type handling

Update tests to use Transaction class methods (getId(),
getVSize(), toBytes()) instead of raw WASM calls.

Export the new Psbt class from the main entry point, replacing
direct WASM type exports. Remove SignPsbtResult type from main
index since it now lives with the Psbt implementation.

Issue: BTC-2650

Co-authored-by: llm-git llm-git@ttll.de

BREAKING CHANGE: Psbt export is now a TypeScript wrapper class instead of
the raw WrapPsbt WASM binding. Transaction methods renamed from snake_case
to camelCase (get_txid -> getId, get_vsize -> getVSize, to_bytes -> toBytes,
from_bytes -> fromBytes). SignPsbtResult type moved to
js/descriptorWallet/Psbt.ts. WrapPsbt module augmentation removed from
js/index.ts.
@OttoAllmendinger OttoAllmendinger force-pushed the BTC-2650.add-psbt-class-wrapper branch from 333d558 to bd20d68 Compare March 12, 2026 14:12
@OttoAllmendinger OttoAllmendinger marked this pull request as ready for review March 12, 2026 14:48
@OttoAllmendinger OttoAllmendinger requested a review from a team as a code owner March 12, 2026 14:48
@OttoAllmendinger OttoAllmendinger merged commit b0b9933 into master Mar 12, 2026
13 checks passed
@OttoAllmendinger OttoAllmendinger deleted the BTC-2650.add-psbt-class-wrapper branch March 12, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants